using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using System.Xml.Serialization;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace Kinlo.Entitys
{
    /// <summary>预充机</summary>
    [Serializable]
    [DataObject]
    [Description("预充机")]
    [BindTable("Precharge", Description = "预充机", ConnName = "MySql", DbType = DatabaseType.None)]
    public partial class Precharge
    {
        #region 属性
        private Int64 _Id;
        /// <summary>雪花ID</summary>
        [DisplayName("雪花ID")]
        [Description("雪花ID")]
        [DataObjectField(true, false, false, 0)]
        [BindColumn("Id", "雪花ID", "")]
        public Int64 Id { get => _Id; set { if (OnPropertyChanging("Id", value)) { _Id = value; OnPropertyChanged("Id"); } } }

        private DateTime _AcquisitionTime;
        /// <summary>数据获取时间</summary>
        [DisplayName("数据获取时间")]
        [Description("数据获取时间")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("Acquisition_Time", "数据获取时间", "")]
        public DateTime AcquisitionTime { get => _AcquisitionTime; set { if (OnPropertyChanging("AcquisitionTime", value)) { _AcquisitionTime = value; OnPropertyChanged("AcquisitionTime"); } } }

        private Int64 _TrayID;
        /// <summary>托盘流水ID</summary>
        [DisplayName("托盘流水ID")]
        [Description("托盘流水ID")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("TrayID", "托盘流水ID", "")]
        public Int64 TrayID { get => _TrayID; set { if (OnPropertyChanging("TrayID", value)) { _TrayID = value; OnPropertyChanged("TrayID"); } } }

        private String _TrayCode;
        /// <summary>托盘码</summary>
        [DisplayName("托盘码")]
        [Description("托盘码")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("TrayCode", "托盘码", "")]
        public String TrayCode { get => _TrayCode; set { if (OnPropertyChanging("TrayCode", value)) { _TrayCode = value; OnPropertyChanged("TrayCode"); } } }

        private String _ProcessNO;
        /// <summary>工序编号 ：OCV,预充</summary>
        [DisplayName("工序编号：OCV")]
        [Description("工序编号 ：OCV,预充")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("ProcessNO", "工序编号 ：OCV,预充", "")]
        public String ProcessNO { get => _ProcessNO; set { if (OnPropertyChanging("ProcessNO", value)) { _ProcessNO = value; OnPropertyChanged("ProcessNO"); } } }

        private String _BatteryCode;
        /// <summary>电芯条码</summary>
        [DisplayName("电芯条码")]
        [Description("电芯条码")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("BatteryCode", "电芯条码", "")]
        public String BatteryCode { get => _BatteryCode; set { if (OnPropertyChanging("BatteryCode", value)) { _BatteryCode = value; OnPropertyChanged("BatteryCode"); } } }

        private Int32 _Position;
        /// <summary>通道号（256通道）位置</summary>
        [DisplayName("通道号")]
        [Description("通道号（256通道）位置")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("Position", "通道号（256通道）位置", "")]
        public Int32 Position { get => _Position; set { if (OnPropertyChanging("Position", value)) { _Position = value; OnPropertyChanged("Position"); } } }

        private Int32 _BatteryStatus;
        /// <summary>电芯状态(0：无电芯 1:OK 2:NG 3:预充NG)</summary>
        [DisplayName("电芯状态")]
        [Description("电芯状态(0：无电芯 1:OK 2:NG 3:预充NG)")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("BatteryStatus", "电芯状态(0：无电芯 1:OK 2:NG 3:预充NG)", "")]
        public Int32 BatteryStatus { get => _BatteryStatus; set { if (OnPropertyChanging("BatteryStatus", value)) { _BatteryStatus = value; OnPropertyChanged("BatteryStatus"); } } }

        private String _NGCode;
        /// <summary>NG代码</summary>
        [DisplayName("NG代码")]
        [Description("NG代码")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("NGCode", "NG代码", "")]
        public String NGCode { get => _NGCode; set { if (OnPropertyChanging("NGCode", value)) { _NGCode = value; OnPropertyChanged("NGCode"); } } }

        private Int32 _Flag;
        /// <summary>0 有效 1无效</summary>
        [DisplayName("0有效1无效")]
        [Description("0 有效 1无效")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("Flag", "0 有效 1无效", "")]
        public Int32 Flag { get => _Flag; set { if (OnPropertyChanging("Flag", value)) { _Flag = value; OnPropertyChanged("Flag"); } } }

        private String _IR;
        /// <summary>IR阻值</summary>
        [DisplayName("IR阻值")]
        [Description("IR阻值")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("IR", "IR阻值", "")]
        public String IR { get => _IR; set { if (OnPropertyChanging("IR", value)) { _IR = value; OnPropertyChanged("IR"); } } }

        private String _Voltage;
        /// <summary>电压</summary>
        [DisplayName("电压")]
        [Description("电压")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Voltage", "电压", "")]
        public String Voltage { get => _Voltage; set { if (OnPropertyChanging("Voltage", value)) { _Voltage = value; OnPropertyChanged("Voltage"); } } }

        private String _Steptype;
        /// <summary>工步类型</summary>
        [DisplayName("工步类型")]
        [Description("工步类型")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Steptype", "工步类型", "")]
        public String Steptype { get => _Steptype; set { if (OnPropertyChanging("Steptype", value)) { _Steptype = value; OnPropertyChanged("Steptype"); } } }

        private String _Current;
        /// <summary>电流</summary>
        [DisplayName("电流")]
        [Description("电流")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Current", "电流", "")]
        public String Current { get => _Current; set { if (OnPropertyChanging("Current", value)) { _Current = value; OnPropertyChanged("Current"); } } }

        private String _Capacity;
        /// <summary>容量</summary>
        [DisplayName("容量")]
        [Description("容量")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Capacity", "容量", "")]
        public String Capacity { get => _Capacity; set { if (OnPropertyChanging("Capacity", value)) { _Capacity = value; OnPropertyChanged("Capacity"); } } }

        private String _Energy;
        /// <summary>能量</summary>
        [DisplayName("能量")]
        [Description("能量")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Energy", "能量", "")]
        public String Energy { get => _Energy; set { if (OnPropertyChanging("Energy", value)) { _Energy = value; OnPropertyChanged("Energy"); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "Id": return _Id;
                    case "AcquisitionTime": return _AcquisitionTime;
                    case "TrayID": return _TrayID;
                    case "TrayCode": return _TrayCode;
                    case "ProcessNO": return _ProcessNO;
                    case "BatteryCode": return _BatteryCode;
                    case "Position": return _Position;
                    case "BatteryStatus": return _BatteryStatus;
                    case "NGCode": return _NGCode;
                    case "Flag": return _Flag;
                    case "IR": return _IR;
                    case "Voltage": return _Voltage;
                    case "Steptype": return _Steptype;
                    case "Current": return _Current;
                    case "Capacity": return _Capacity;
                    case "Energy": return _Energy;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "Id": _Id = value.ToLong(); break;
                    case "AcquisitionTime": _AcquisitionTime = value.ToDateTime(); break;
                    case "TrayID": _TrayID = value.ToLong(); break;
                    case "TrayCode": _TrayCode = Convert.ToString(value); break;
                    case "ProcessNO": _ProcessNO = Convert.ToString(value); break;
                    case "BatteryCode": _BatteryCode = Convert.ToString(value); break;
                    case "Position": _Position = value.ToInt(); break;
                    case "BatteryStatus": _BatteryStatus = value.ToInt(); break;
                    case "NGCode": _NGCode = Convert.ToString(value); break;
                    case "Flag": _Flag = value.ToInt(); break;
                    case "IR": _IR = Convert.ToString(value); break;
                    case "Voltage": _Voltage = Convert.ToString(value); break;
                    case "Steptype": _Steptype = Convert.ToString(value); break;
                    case "Current": _Current = Convert.ToString(value); break;
                    case "Capacity": _Capacity = Convert.ToString(value); break;
                    case "Energy": _Energy = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得预充机字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary>雪花ID</summary>
            public static readonly Field Id = FindByName("Id");

            /// <summary>数据获取时间</summary>
            public static readonly Field AcquisitionTime = FindByName("AcquisitionTime");

            /// <summary>托盘流水ID</summary>
            public static readonly Field TrayID = FindByName("TrayID");

            /// <summary>托盘码</summary>
            public static readonly Field TrayCode = FindByName("TrayCode");

            /// <summary>工序编号 ：OCV,预充</summary>
            public static readonly Field ProcessNO = FindByName("ProcessNO");

            /// <summary>电芯条码</summary>
            public static readonly Field BatteryCode = FindByName("BatteryCode");

            /// <summary>通道号（256通道）位置</summary>
            public static readonly Field Position = FindByName("Position");

            /// <summary>电芯状态(0：无电芯 1:OK 2:NG 3:预充NG)</summary>
            public static readonly Field BatteryStatus = FindByName("BatteryStatus");

            /// <summary>NG代码</summary>
            public static readonly Field NGCode = FindByName("NGCode");

            /// <summary>0 有效 1无效</summary>
            public static readonly Field Flag = FindByName("Flag");

            /// <summary>IR阻值</summary>
            public static readonly Field IR = FindByName("IR");

            /// <summary>电压</summary>
            public static readonly Field Voltage = FindByName("Voltage");

            /// <summary>工步类型</summary>
            public static readonly Field Steptype = FindByName("Steptype");

            /// <summary>电流</summary>
            public static readonly Field Current = FindByName("Current");

            /// <summary>容量</summary>
            public static readonly Field Capacity = FindByName("Capacity");

            /// <summary>能量</summary>
            public static readonly Field Energy = FindByName("Energy");

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得预充机字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary>雪花ID</summary>
            public const String Id = "Id";

            /// <summary>数据获取时间</summary>
            public const String AcquisitionTime = "AcquisitionTime";

            /// <summary>托盘流水ID</summary>
            public const String TrayID = "TrayID";

            /// <summary>托盘码</summary>
            public const String TrayCode = "TrayCode";

            /// <summary>工序编号 ：OCV,预充</summary>
            public const String ProcessNO = "ProcessNO";

            /// <summary>电芯条码</summary>
            public const String BatteryCode = "BatteryCode";

            /// <summary>通道号（256通道）位置</summary>
            public const String Position = "Position";

            /// <summary>电芯状态(0：无电芯 1:OK 2:NG 3:预充NG)</summary>
            public const String BatteryStatus = "BatteryStatus";

            /// <summary>NG代码</summary>
            public const String NGCode = "NGCode";

            /// <summary>0 有效 1无效</summary>
            public const String Flag = "Flag";

            /// <summary>IR阻值</summary>
            public const String IR = "IR";

            /// <summary>电压</summary>
            public const String Voltage = "Voltage";

            /// <summary>工步类型</summary>
            public const String Steptype = "Steptype";

            /// <summary>电流</summary>
            public const String Current = "Current";

            /// <summary>容量</summary>
            public const String Capacity = "Capacity";

            /// <summary>能量</summary>
            public const String Energy = "Energy";
        }
        #endregion
    }
}